42d89ab6f1213b28d2071f34727bd9e55c8f98c2,src/main/java/groovyx/net/http/NativeHandlers.java,Encoders,xml,#ChainedHttpConfig.ChainedRequest#,214
Before Change
StringEntity ret;
if(body instanceof String) {
ret = new StringEntity(body.toString(), request.actualCharset());
}
else if(body instanceof Closure) {
final StreamingMarkupBuilder smb = new StreamingMarkupBuilder();
ret = new StringEntity(smb.bind(body).toString(), request.actualCharset());
}
else {
throw new UnsupportedOperationException();
}
ret.setContentType(contentType);
return ret;
}
public static HttpEntity json(final ChainedHttpConfig.ChainedRequest request) {
After Change
public static void xml(final ChainedHttpConfig.ChainedRequest request, final ToServer ts) {
final Object body = checkNull(request.actualBody());
final String contentType = request.actualContentType();
checkTypes(contentType, body, XML_TYPES);
if(body instanceof String) {
ts.toServer(contentType, stringToStream((String) body, request.actualCharset()));
}
else if(body instanceof Closure) {
final StreamingMarkupBuilder smb = new StreamingMarkupBuilder();